package com.tbmob.tb_h5;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;

public class NewsFeedFragmentActivity extends FragmentActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_NO_TITLE);// 隐藏标题栏
        //getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);// 隐藏状态栏

        String codeId = getIntent().getStringExtra("codeId");

        setContentView(R.layout.activity_news_feed);

        ImageView title_iv = findViewById(R.id.a_title_iv);
        title_iv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        //新闻资讯
        com.tb.mob.TbNewsFeedManager.replaceFrameLayout(this, codeId, "", "", new com.tb.mob.TbNewsFeedManager.IReplaceListener() {
            @Override
            public void onFail(String msg) {

            }

            @Override
            public void getContentPage(Fragment feedPage) {
                getSupportFragmentManager().beginTransaction()
                        .replace(R.id.fragment_container, feedPage)
                        .commitAllowingStateLoss();
            }
        });
    }
}
